package com.zhiy.com.estation.ui;

import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.zhiy.com.estation.R;

import com.zhiy.com.estation.app.App;
import com.zhiy.com.estation.fragmentTag.FragmentTag;
import com.zhiy.com.estation.manager.PreferenceManager;
import com.zhiy.com.estation.ui.base.BaseActivity;
import com.zhiy.com.estation.ui.fragment.Fragment_Life;
import com.zhiy.com.estation.ui.fragment.Fragment_Login;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Zyh on 2016/12/2.
 */
public class StartUpActivity extends BaseActivity  {
    Handler handler=new Handler(){
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
                startActivity(new Intent(StartUpActivity.this,MainActivity.class));
                finish();
                //ovrridePendingTransition--切换activity的添加动画使用
                //第一个参数是：第二个Activity进来的动画，第二个是第一个activity退出的动画
                overridePendingTransition(R.anim.fragment_enter,R.anim.fragment_exit);
        }
    };
    @Override
    protected int getLayoutId() {
        return R.layout.start_up;
    }
    @Override
    protected void initView() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    //休眠3秒
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                handler.sendEmptyMessage(0);
            }
        }).start();
    }
//    @OnClick(R.id.example_bt)
//    public void toFraLogin(View view) {
//        Log.d("----","跳转login");
//        showFragment(Fragment_Login.class,FragmentTag.LOGIG,null,true);
//    }


}
